package com.appkubes.mall.core.pojo;

import com.appkubes.mall.core.po.FintechCreditHistory;
import com.appkubes.mall.core.po.FintechCreditHistoryExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface FintechCreditHistoryMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table fintech_credit_history
     *
     * @mbg.generated
     */
    @SelectProvider(type=FintechCreditHistorySqlProvider.class, method="countByExample")
    long countByExample(FintechCreditHistoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table fintech_credit_history
     *
     * @mbg.generated
     */
    @DeleteProvider(type=FintechCreditHistorySqlProvider.class, method="deleteByExample")
    int deleteByExample(FintechCreditHistoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table fintech_credit_history
     *
     * @mbg.generated
     */
    @Delete({
        "delete from fintech_credit_history",
        "where credit_history_key = #{creditHistoryKey,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String creditHistoryKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table fintech_credit_history
     *
     * @mbg.generated
     */
    @Insert({
        "insert into fintech_credit_history (credit_history_key, app_key, ",
        "user_key, credit_amount, ",
        "credit_change, change_reason, ",
        "create_time)",
        "values (#{creditHistoryKey,jdbcType=VARCHAR}, #{appKey,jdbcType=VARCHAR}, ",
        "#{userKey,jdbcType=VARCHAR}, #{creditAmount,jdbcType=INTEGER}, ",
        "#{creditChange,jdbcType=INTEGER}, #{changeReason,jdbcType=VARCHAR}, ",
        "#{createTime,jdbcType=TIMESTAMP})"
    })
    int insert(FintechCreditHistory record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table fintech_credit_history
     *
     * @mbg.generated
     */
    @InsertProvider(type=FintechCreditHistorySqlProvider.class, method="insertSelective")
    int insertSelective(FintechCreditHistory record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table fintech_credit_history
     *
     * @mbg.generated
     */
    @SelectProvider(type=FintechCreditHistorySqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="credit_history_key", property="creditHistoryKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_key", property="userKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="credit_amount", property="creditAmount", jdbcType=JdbcType.INTEGER),
        @Result(column="credit_change", property="creditChange", jdbcType=JdbcType.INTEGER),
        @Result(column="change_reason", property="changeReason", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<FintechCreditHistory> selectByExampleWithRowbounds(FintechCreditHistoryExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table fintech_credit_history
     *
     * @mbg.generated
     */
    @SelectProvider(type=FintechCreditHistorySqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="credit_history_key", property="creditHistoryKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_key", property="userKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="credit_amount", property="creditAmount", jdbcType=JdbcType.INTEGER),
        @Result(column="credit_change", property="creditChange", jdbcType=JdbcType.INTEGER),
        @Result(column="change_reason", property="changeReason", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<FintechCreditHistory> selectByExample(FintechCreditHistoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table fintech_credit_history
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "credit_history_key, app_key, user_key, credit_amount, credit_change, change_reason, ",
        "create_time",
        "from fintech_credit_history",
        "where credit_history_key = #{creditHistoryKey,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="credit_history_key", property="creditHistoryKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="user_key", property="userKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="credit_amount", property="creditAmount", jdbcType=JdbcType.INTEGER),
        @Result(column="credit_change", property="creditChange", jdbcType=JdbcType.INTEGER),
        @Result(column="change_reason", property="changeReason", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP)
    })
    FintechCreditHistory selectByPrimaryKey(String creditHistoryKey);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table fintech_credit_history
     *
     * @mbg.generated
     */
    @UpdateProvider(type=FintechCreditHistorySqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") FintechCreditHistory record, @Param("example") FintechCreditHistoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table fintech_credit_history
     *
     * @mbg.generated
     */
    @UpdateProvider(type=FintechCreditHistorySqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") FintechCreditHistory record, @Param("example") FintechCreditHistoryExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table fintech_credit_history
     *
     * @mbg.generated
     */
    @UpdateProvider(type=FintechCreditHistorySqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(FintechCreditHistory record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table fintech_credit_history
     *
     * @mbg.generated
     */
    @Update({
        "update fintech_credit_history",
        "set app_key = #{appKey,jdbcType=VARCHAR},",
          "user_key = #{userKey,jdbcType=VARCHAR},",
          "credit_amount = #{creditAmount,jdbcType=INTEGER},",
          "credit_change = #{creditChange,jdbcType=INTEGER},",
          "change_reason = #{changeReason,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP}",
        "where credit_history_key = #{creditHistoryKey,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(FintechCreditHistory record);
}